package Zhouliu;
//计时工
public class HourlyEmployee extends Employee{
    private double hourMoney;
    private int hour;
    public HourlyEmployee(){
    }
    public HourlyEmployee(double hourMoney, int hour) {
        super("李四",5);
        this.hourMoney = hourMoney;
        this.hour = hour;
    }

    @Override
    public double getSalary(int month) {
        double price = 0;
        if (getBirMonth() == month){
            price+=100;
            System.out.println("生日红包:"+100+"元!");
        }
        if (hour>160){
            price += (160*hourMoney+(hour-160)*1.5*hourMoney);
            System.out.println(getName()+"薪资:"+price);
            return price;
        }else {
            price += hour*hourMoney;
            System.out.println(getName()+"薪资:"+price);
            return price;
        }

    }
    @Override
    public void print() {
        super.print();
    }
    public double getHourMoney() {
        return hourMoney;
    }
    public void setHourMoney(double hourMoney) {
        this.hourMoney = hourMoney;
    }
    public int getHour() {
        return hour;
    }
    public void setHour(int hour) {
        this.hour = hour;
    }
}

